Socket monitoring

ABSTRACT

This applications relates to methods and apparatus for monitoring a socket ( 101 ), to detect a connection status of a mating plug ( 102 ), e.g. for monitoring an audio jack socket for connection of an audio jack plug. A monitor ( 115, 305 ) is configured to monitor a voltage (V M ) at a monitoring node ( 114 ), which is coupled to a jack detect contact ( 112 ) of the socket and a voltage pull-up element ( 113 ). The voltage (V M ) at the monitoring node ( 114 ) is monitored against a threshold (Vthv) and a threshold module ( 302 ) is configured to vary the threshold depending on an indication of signal activity (S ACT ) of a signal path for a first socket contact ( 103 ) which will be electrically connected to the jack detect contact when a plug when inserted in the socket.

TECHNICAL FIELD

The field of representative embodiments of this disclosure relates tomethods, apparatus and/or implementations concerning or relating tomonitoring of a socket and in particular to monitoring a socket todetect a connection status, e.g. connection or disconnection of asuitable mating plug.

BACKGROUND

Many contemporary electronic devices have the facility to connect withan accessory apparatus such as a peripheral audio apparatus. Forinstance, mobile telephones, tablets, laptop computers and the like areexamples of electronic devices that are operable with an accessoryapparatus such as a headset, for example, that is external to anddistinct from the electronic device. Headsets typically comprise mono orstereo speakers for audio playback and a microphone for voicecommunication.

Such external accessory apparatus may, in use, be physically connectedto the electronic device via a mating connector such as a plug andsocket arrangement. For instance, many headsets have a jack plug forconnection to a suitable jack socket on the host electronic device. Awell-known arrangement for a jack plug and its associated socket is the3.5 mm TRRS (Tip-Ring-Ring-Sleeve), which has four contacts for leftaudio, right audio, microphone, and ground return. In one knownarrangement, the tip (T) and first ring (R1) are used for left (L) andright (R) audio respectively, for example left and right loudspeakers,with the second ring (R2) and sleeve (S) used for the ground (G) andmicrophone (M) respectively. It will be appreciated that differentarrangements for the left and right audio, microphone, and groundcontacts are also possible.

Advantageously the electronic device should be able to automaticallydetect whether or not an accessory such as a peripheral audio device isconnected. Typically therefore the device will include a socketmonitoring arrangement associated with the socket to detect whether ornot a suitable mating plug is correctly inserted in the socket.

In some instances the socket monitoring arrangement may comprise amechanical switch which is activated by insertion or removal of a plugfrom the socket. For instance a mechanical switch could be located atthe end of the socket and biased to a first state, e.g. open, if a plugis not fully inserted but which is moved to the other state, e.g.closed, when a plug is fully inserted. Mechanical switches may howeverbe subject to wear and tear in use and may fail over time or the actionof the switch may become blocked by dirt etc. accumulating in thesocket.

As an alternative in some instances independent first and second socketcontacts may be arranged to contact one pole of the plug, usually thetip, when correctly inserted and the electrical properties of the firstand second socket contacts monitored. When the plug is fully insertedthe first and second socket contacts are effectively shorted togethervia a low resistance path provided by the tip of the plug. When the plugis removed the first and second socket contacts are open circuit. Theelectrical properties of the first and second socket contacts may bemonitored to detect when the two contacts are electrically connected asan indication of the mating status of the plug. However the distancebetween the first and second socket contacts is relatively small andmoisture within the socket, or some dirt or foreign objects couldprovide a conductive pathway between the contacts.

SUMMARY

Embodiments of the present invention relate to improve methods andapparatus for monitoring of a socket to determine a connection status,in particular to detecting whether a mating plug is connected or hasbeen disconnected.

According to some embodiments there is provided a socket monitoringcircuit comprising:

-   -   a monitor configured to monitor a voltage at a monitoring node        against a variable threshold;    -   wherein the monitoring node is coupled, in use, to a jack detect        contact of the socket and a voltage pull-up element; and    -   a threshold module configured to vary said variable threshold        depending on an indication of signal activity of a signal path        for a first socket contact to which the monitoring node may be        electrically connected via a pole of a plug when inserted in the        socket.

In some embodiments the threshold module may be configured to set thevariable threshold to a first value when the indication of signalactivity indicates a first level of activity and to set the variablethreshold to a second value, higher than the first value, when theindication of signal activity indicates a second greater level ofactivity.

In some implementations the indication of signal activity may be anindication of activity of an audio signal path for supplying an audiodriving signal to the first socket contact of the socket.

The first socket contact may be a tip contact of the socket forcontacting a tip pole of a plug when fully inserted in the socket.

In some implementations the indication of signal activity may comprisean indication of output signal level for an output of a first drivingcircuit coupled, in use, to the first socket contact. The thresholdmodule may be configured to receive the indication of output signallevel from the first driving circuit or may be configured to receive theindication of output signal level from a processing module upstream ofthe first driving circuit. In some implementations the indication ofsignal activity may, additionally or alternatively, comprise anindication of whether a driver component of a driving circuit forproviding a driving signal to the first socket contact is enabled ornot. The driver component of the driving circuit may comprise anamplifier. In some implementations the indication of signal activitymay, additionally or alternatively, comprise an indication of whether aclamp switch for clamping the signal path for the first socket contactto ground is enabled or not. In some implementations the indication ofsignal activity may, additionally or alternatively, comprise anindication of a volume control signal.

In some implementations a parameter of the pull-up element may bevariable so as to vary a magnitude of expected current flow between thepull up-element and the jack detect contact of the socket in the eventthat the jack detect contact is electrically connected to the firstsocket contact. The monitoring circuit may be configured to vary theparameter of the pull-up element based on said indication of signalactivity. The monitoring circuit may be configured to vary the parameterof the pull-up element so as to provide a higher magnitude of expectedcurrent flow when the indication of signal activity indicates that thereis some signal activity at said first socket contact than when theindication of signal activity indicates that there is substantially nosignal activity at said first socket contact. In some implementationsthe threshold module may be configured to vary the parameter of saidpull-up element when varying the variable threshold. The parameter ofthe pull-up element may comprise a value of resistance coupled, in use,between a first voltage and the monitoring node. The parameter of thepull-up element may comprise an output current of a programmable currentsource arrangement.

The pull-up element may, in some implementations, comprise at least afirst resistor coupled, in use, between a first voltage and themonitoring node. In some implementations the pull-up element maycomprise a current source.

The monitor may comprise at least one comparator for comparing thevoltage at the monitoring node with the variable threshold.

The socket monitoring circuit may further comprise a controllerresponsive to the monitor and configured to determine a connectionstatus of a plug based on the output of the monitor. The controller maybe configured to control operation of at least one signal path to one ofthe socket contacts based on the determined connection status. Thecontroller may additionally or alternatively be configured to determinedisconnection of a plug from the socket in the event the output of themonitor changes state to indicate that the voltage at the monitoringnode has increased from below the variable threshold to above thevariable threshold. In the event that the controller determinesdisconnection of a plug from the socket, the controller may beconfigured to generate a control signal to disable a microphone biasfrom being applied to a socket contact of the socket and/or to generatea control signal to enable a clamp switch to clamp a path for amicrophone bias to ground.

The socket monitoring circuit may be implemented as at least part of anintegrated circuit. In some embodiments the integrated circuit maycomprise an audio codec.

Embodiments also relates to an apparatus comprising a socket monitoringcircuit as described in any of the variants herein and a socket forreceiving a mating plug of an accessory apparatus, the socket comprisingthe jacket detect contact and the first socket contact arranged so as tocontact the same pole of the mating plug when inserted into the socket.The socket may, in some instances, be a 3.5 mm TRRS socket.

Embodiments also relates to an electronic device comprising theapparatus. The device may be at least one of: a portable device; abattery powered device; a communications device; a mobile or cellulartelephone or a smartphone; a computing device; a laptop, notebook ortablet computing device; a voice controlled or voice activated device; awearable device; a domestic appliance.

Aspects also relate to an apparatus comprising:

-   -   a socket for receiving a mating plug of an accessory apparatus,    -   a first audio driver for outputting an audio drive signal to a        first contact of the socket;    -   a jack detect contact configured such that the jack detect        contact and first socket contact make contact with a same pole        of the mating plug when inserted;    -   a voltage pull up element coupled to the jack detect contact;        and    -   a monitor for monitoring the voltage at the jack detect contact        with a threshold controlled by a threshold module;    -   wherein the threshold module is configured to controllably vary        said threshold based on an indication of the output activity of        the first audio driver.

Aspects also relate to a socket monitoring circuit comprising: a monitorconfigured to monitor a voltage at a monitoring node against athreshold; wherein the threshold is variable based on an indication ofsignal level output from an audio circuit to the socket.

BRIEF DESCRIPTION OF THE DRAWINGS

For a better understanding of examples of the present disclosure, and toshow more clearly how the examples may be carried into effect, referencewill now be made, by way of example only, to the following drawings inwhich:

FIG. 1a illustrates one example of a socket arrangement with socketmonitoring circuitry and FIG. 1b illustrates one example of audioapparatus of an accessory apparatus;

FIG. 2 illustrates plots of how voltage at a monitoring node may changeover time for different values of pull-up resistance;

FIG. 3 illustrates one example of a socket arrangement with socketmonitoring circuitry according to an embodiment;

FIG. 4 illustrates the principles of applying different thresholds forthe voltage at the monitoring node;

FIG. 5 illustrates one example of a monitor for monitoring the voltageat the monitoring node;

FIG. 6 illustrates socket monitoring circuitry according to anotherembodiment; and

FIG. 7 illustrates a device according to an embodiment.

DETAILED DESCRIPTION

The description below sets forth example embodiments according to thisdisclosure. Further example embodiments and implementations will beapparent to those having ordinary skill in the art. Further, thosehaving ordinary skill in the art will recognize that various equivalenttechniques may be applied in lieu of, or in conjunction with, theembodiments discussed below, and all such equivalents should be deemedas being encompassed by the present disclosure.

Embodiments of the present disclosure relate to methods and apparatusfor monitoring of a socket of a device to determine a connection status,i.e. to determine when a mating plug is fully inserted in the socket.

FIG. 1a illustrates generally one example of circuit arrangement 100 formonitoring a socket 101 of a device. In this example the socket 101 is ajack socket suitable for receiving a 4-pole jack plug, for instance a3.5 mm TRRS jack plug as is well known for transfer of audio signals.Such a plug has four poles, T (tip), R1 (ring 1), R2 (ring 2) and S(sleeve) as will be understood by one skilled in the art.

Four socket contacts 103-106 are arranged within the socket 101 so as tocontact the respective T, R1, R2 and S poles of the plug 102 when fullyinserted into the socket 101. In use various signals may be transferredto and from the socket contacts 103-106 for operating a connectedaccessory apparatus. FIG. 1 illustrates one configuration for use withan audio accessory having stereo loudspeakers and a microphone. Firstand second audio driver circuits 107 and 108, e.g. comprising headphonedriver amplifiers or the like, are connected to supply audio drivesignals to socket contacts 103 and 104 respectively. Typicallyconnections are made to drive the T pole with a left audio drive signalV_(DL) and the R1 pole with a right audio drive signal V_(DR).

One socket contact, in this illustrated example contact 105, isconnected to provide a ground return path to a pole of the plug 102 (inthis example the R2 pole), and the other socket contact, in this examplesocket contact 106, is used for the microphone. A microphone biasingcircuit 109 provides a bias voltage V_(BIAS) to the socket contact 105to bias the microphone of the accessory apparatus and a microphone inputcircuit 110 monitors the socket contact 106 to detect any inputmicrophone signal.

FIG. 1b illustrates the corresponding connections within an accessoryapparatus and illustrates that the T and R1 poles of the plug 102 may beconnected to respective loudspeakers for left and right audio L and R,and the S pole connected to a microphone M, with the loudspeakers andmicrophone also being connected to the R2 pole to provide a groundreturn path G.

It will be understood by one skilled in the art that the arrangementillustrated in FIGS. 1a and 1b corresponds to one possible configurationand other configurations are known, for instance some accessories usethe R2 pole for the microphone and the S pole for ground. The socketcircuitry may also be configurable for use with devices without amicrophone and which use a 3-pole jack plug and/or may be configurablefor use with other accessories, which may be non-audio accessories.

To provide jack detection monitoring, i.e. detection of whether or not ajack plug 102 is inserted in the jack socket 101, monitoring circuitry111 may be coupled to a jack detect contact 112 of the socket 101. Thejack detect contact 112 is arranged so as to contact one of the poles ofthe jack plug 102, when fully inserted, such that the jack detectcontact 112 contacts the same pole of the plug 102 as one of the othersocket contacts 103-106, typically the first socket contact 103 forconnecting the tip T pole, which, as discussed above, may, in use, becoupled to the first audio driver circuit 107.

The monitoring circuitry 111 comprises a pull-up element 113, which inthis example comprises a resistor coupled between a first voltage V1 anda monitoring node 114. The monitoring node 114 is, in use, electricallycoupled to the jack detect contact 112. The monitoring node 114 is alsocoupled to a monitor 115, which in this example comprises a comparatorfor comparing a voltage at the monitoring node 114 to a thresholdvoltage Vth.

In use, if no jack plug 101 is present in the jack socket 102, the jackdetect contact 112 should be electrically isolated from the first socketcontact 103, that is the relevant two contacts are open circuit. In thisstate, the pull up element 113 thus results in the voltage V_(M) at themonitoring node 114 being pulled high to substantially the first voltageV1.

When the plug 102 is fully inserted into the socket, the tip T pole ofthe plug 102 electrically connects the jack detect contact 112 to thefirst socket contact 103. The first socket contact 103 is connected tothe audio driver circuit 107, which has an output that is typicallyclamped to ground when the audio driver circuit 107 is not in use andwhich otherwise is ground referenced. This provides a circuit path forcurrent flow between the jack detect contact 112 and the first socketcontact 103 and results in the voltage V_(M) at the monitoring node 114being pulled down below the first voltage V1 when a plug 102 iscorrectly inserted in the socket 101.

The threshold voltage Vth is conventionally set such that, with the plug102 present, the voltage V_(M) at the monitoring node 114 drops belowthe threshold Vth, but if the plug 102 is not present the voltage V_(M)at the monitoring node 114 will be above the threshold Vth. For example,in some instances the first voltage V1 may be a voltage available to theaudio driver circuitry, e.g. headphone amplifier circuitry 107, and mayfor instance be a voltage in the range of about 1.5-2V. The voltagethreshold Vth could conventionally be set to be in the region of 70-90%of the first voltage V1. The resistance of pull-up resistor 113 may bechosen to provide a sufficient pull-up action for clear detection ofwhen a plug 102 is inserted, but without resulting in any significantaudible artefacts being generated on plug insertion or removal. Forexample a resistance of the order of a megaohm or so may be used in someconventional implementations.

The comparator 115 monitors the voltage V_(M) at the monitoring node 114against the threshold Vth. The output of the comparator 115 indicateswhether or not the monitored voltage is above the threshold Vth and canbe used as an indication of whether or not a jack plug 102 is inserted.

Such an arrangement avoids the need for any mechanical switch for jackdetection and the associated problems therewith.

However a problem can arise if moisture is present within the socket101. Moisture within the socket 101 may provide a conductive pathbetween the jack detect contact 112 and the first socket contact 103.Any significant current flow due to moisture is disadvantageous andcould result in damage to or corrosion of the contacts, e.g. throughoxidation.

To reduce the extent of any current flow that may occur when moisture ispresent in the socket 101, the pull-up element 113 could be arranged toprovide a relatively limited current in use. For instance the resistor113 could be a relatively high value resistor. For example a resistancesay of the order of a few tens of megaohms or so may limit the extent ofany current due to moisture to acceptable limits in someimplementations.

However using a high value of resistance for pull-up resistor 113, orotherwise limiting the current that is provided by the pull-up element,can introduce a time lag into detection of connection and/ordisconnection. In practice there will be some stray or parasiticcapacitance C_(P) associated with the monitoring node 114 andcorresponding conductive paths of the monitoring circuit and path to thejack detect contact 112. The pull-up resistor 113, together with such aparasitic capacitance C_(P), effectively act as a low-pass filter with atime constant that is proportional to the value of the resistance. Thusa high value of resistance for pull-up resistor 113 can result in thevoltage V_(M) at the monitoring node only changing relatively slowly.

For instance consider that a plug 102 is present in the socket 101, sothat the jack detect socket contact 112 is electrically connected to thefirst socket contact 103 via the T pole of the plug. If the first socketcontact 103 is at ground, and the plug 102 has been present for arelatively long period of time, the voltage V_(M) at the monitoring node114 will have been pulled down to be substantially at ground. The outputof comparator 115 will, in this situation, indicate that the voltageV_(M) at the monitoring node 114 is below the threshold Vth and thusindicate that the plug 102 is inserted.

If the plug 102 is then removed, the jack detect contact 112 will beelectrically disconnected from the first socket contact 103, i.e.disconnected from ground, and the voltage V_(M) at the monitoring nodewill rise over time, as illustrated in FIG. 2. FIG. 2 shows a plot 201of how the voltage V_(M) at the monitoring node 114 may increase overtime, starting from ground at the time that the pole T of the plug 102is first disconnected from the jack detect contact 112 and/or firstsocket contact 103, and rising to the threshold voltage Vth at a timeT1. At the time T1 the output of the comparator 115 would change statethus indicating the plug 102 has been removed.

The time taken the reach the threshold will depend on the resistance ofpull-up resistor 113, or more generally by the current delivered by thepull-up element 113 (simplistically the time taken to charge theparasitic capacitance C_(P)). The higher the resistance of pull-upresistor 113, the longer it will take for the voltage V_(M) at themonitoring node 114 to reach the threshold Vth. FIG. 2 also illustratesa plot 202 of how the voltage V_(M) may rise over time followingdisconnection of the plug 102, but for a second, higher value ofresistance for pull-up resistor 113. The time between disconnection ofthe plug 102 from the jack detect contact 112 and/or first socketcontact 103 and the time T2 at which the voltage V_(M) reaches thethreshold Vth is greater in this instance, with the respective periodbeing proportional to the value of resistance of the pull-up resistor113.

A high value of resistance for the pull-up resistor 113 can thereforeresult in the monitoring circuitry 111 taking a relatively long time toregister that the jack detect contact 112 has been disconnected from thefirst socket contact 103, indicating removal of the plug 102.

In general it may be desirable to register electrical disconnection ofthe jack detect contact 112 from the first socket contact 103 relativelyquickly. In particular it may be desirable to detect when the plug 102is in the process of being removed from the socket 101 so as to controlthe signals/voltages applied to at least one of the other socketcontacts 104-106 to reduce the possibility of unwanted audibleartefacts.

As discussed above the jack plug 102 may comprise a linear arrangementof poles, and the tip T and first ring R1 poles of the jack plug 102 maybe coupled to loudspeakers of the accessory apparatus, e.g. asillustrated in FIG. 1b . As also discussed, in use a bias voltageV_(BIAS) for the microphone of the accessory apparatus may be developedand supplied to socket contact 106 (or socket contact 105 in someconfigurations). On removal of the jack plug 102 from the socket 101,various poles of the plug may be moved past socket contacts to whichthey are not normally connected. This may cause electrical currents topass through loudspeakers attached to these poles and produce audibleartefacts. For instance, if the plug illustrated in FIG. 1a is pulledone step to the right relative to the socket contacts, then the plugcontact R2 (wired to the ground return path from the accessory asillustrated in FIG. 1b ) will contact socket contact S, which connectedto the microphone bias circuitry 109. At the same time, the plug contactR1 (wired to the right loudspeaker) will be connected to socket contactR2 (connected to ground). Thus if the microphone bias circuitry is stillactive, the right loudspeaker will become subject to the microphone biasV_(BIAS) being applied at one terminal and ground at the other, and willpass a resulting current, producing an audible click or thump, which isundesirable.

It may therefore be desirable that the monitoring circuitry 111 detectselectrical disconnection of jack detect contact 112 from the firstsocket contact 103 sufficiently fast that the microphone bias V_(BIAS)can be substantially disabled, i.e. removed, before the R1 and R2 polesof the plug are likely to come into contact with the socket contact 106to which the microphone bias V_(BIAS) is applied. The jack detectcontact 112 may be positioned so it makes contact with the T pole of theplug 102 at, or near, the far end of the tip, so that, as soon as theplug 102 starts to be removed from the socket 101, the jack detectcontact 112 is electrically disconnected from the first socket contact103.

In some implementations it may be desirable to disable the microphonebias V_(BIAS) within a few hundred microseconds from the onset of theplug 102 being removed from the socket 101, e.g. from the time at whichthe jack detect contact 112 is electrically disconnected from the firstsocket contact 103.

For an arrangement such as illustrated in FIG. 1 the monitoringcircuitry 111 may, in some implementations, be operable to detectdisconnection of the jack detect contact 112 from the first socketcontact 103 in a period less than 100 microseconds, when using aresistance value of about 1 MΩ for the pull-up resistor 113. However asnoted above it may be preferred in some implementations to have asignificantly higher value of resistance for the pull-up resistor 113 tolimit current flow in the event of moisture in the socket. A resistancevalue of say 10 MΩ would however result in a time for detectingdisconnection of the jack detect contact 112 from the first socketcontact 103 of a few hundred microseconds, which may be too slow.

Embodiments of the present disclosure relate to improved socketmonitoring circuitry. In embodiments of the disclosure a socketmonitoring circuit comprises a monitor for monitoring a voltage at amonitoring node, the monitoring node being coupled, in use, to a voltagepull-up element and also a jack detect contact of the socket. Themonitor is configured to monitor the voltage at the monitoring nodeagainst a threshold. A threshold module is configured to vary thethreshold depending on an indication of signal activity in a signal pathfor a first socket contact to which the monitoring node may beelectrically connected via a pole of a plug when inserted in the socket.

FIG. 3 illustrates one example of a socket arrangement 300 having amonitoring circuit 301 according to an embodiment in which similarcomponents to those discussed previously are identified by the samereference numerals.

The monitoring circuit 301 again comprises a monitoring node 114 coupledto a jack detect contact 112 of the socket 101. As discussed above thejack detect contact 112 is arranged to make contact with the same poleof a plug 102 as one of the other socket contacts 103-106, when a plug102 is present and fully inserted within the socket 101. As describedabove the jack detect contact 112 may advantageously be arranged to makecontact with the tip T pole of the plug 102 and thus may, when the plug102 is fully inserted, be electrically connected to a first socketcontact 103 which may, in use, receive a signal V_(DL) from a firstdriver circuit 107, which may be an audio driver circuit.

The monitoring node 114 is connected to a pull-up element 113, in thisexample a resistor connected to a first voltage V1. A monitor 115, whichin this example comprises a comparator, is arranged to monitor thevoltage V_(M) at the monitoring node 114 against a threshold. Inembodiments of the disclosure however the threshold is a variablethreshold Vthv. In this example the variable threshold Vthv applied iscontrolled by a threshold module 302.

The threshold module 302 is responsive to an indication of any signalactivity for the signal path connected to the first socket contact 103,i.e. the extent of activity of the signal V_(DL) applied to the firstsocket contact 103. In particular the variable threshold Vthv may be setto be relatively low for relatively lower levels of signal activity atthe first socket contact 103 and may be set to be higher for relativelyhigher levels of signal activity at the first socket contact 103.

Such an arrangement can advantageously allow use of a pull-up element113 that provides a relatively low current in use, e.g. a pull-upresistor 113 with a relatively high resistance value, say of the orderof several megaohms or tens of megaohms, but still allow the monitoringcircuitry 301 to detect plug removal fast enough to prevent unwantedaudible artefacts, for instance by disabling the microphone biasV_(BIAS).

Setting the variable threshold Vthv to a lower level means that thevoltage V_(M) of the monitoring node 114 will reach the threshold levelfaster following disconnection of the jack detect socket contact 112from the first socket contact 103 on onset of plug removal.

FIG. 4 illustrates the principle. FIG. 4 illustrates the same plot 202as FIG. 2, showing how the voltage V_(M) at the monitoring node 114 mayincrease from ground, on electrical disconnection of the jack detectcontact 112 from the first socket contact 103, if the value ofresistance for pull-up resistor 113 is relatively high. As discussedabove the time taken for the voltage V_(M) to reach a relatively highthreshold value, in this instance Vth2 at a time T2, may be relativelylong, for instance of the order of a few hundred microseconds. Such adetection time period may be too slow to prevent audible artefacts asthe plug 102 is removed. In embodiments of the disclosure the variablethreshold Vthv may therefore, in defined circumstances, be set to be alower value Vth1. It will take less time for the voltage V_(M) at themonitoring node 114 to reach this lower threshold Vth1, at a time T1,than the higher threshold vth2, and thus disconnection of the plug 102may be detected faster. FIG. 4 also illustrates, for comparison, thesame plot 201 from FIG. 2 showing how the voltage V_(M) could change fora lower resistance value of pull-up resistor 113, as may be moreconventional, and illustrates that the lower threshold Vth2 could, insome implementations, be set so as to provide a comparable time fordetecting disconnection as would be the case using the higher thresholdVth2 and lower resistance value of pull-up resistor 113.

It will be appreciated however that, in use with the plug 102 fullyinserted in the socket 101, any driving signal Von supplied to the firstsocket contact 103 by the audio driver circuit 107 may be coupled to thevoltage monitoring node 114 via the T pole of the plug. Conventionallythe threshold Vth illustrated in FIG. 2 would be set to be outside thenormal operational signal range of the driving signal V_(DL) supplied tothe first socket contact 103, i.e. greater than the maximum expectedsignal driving voltage V_(DL-MAX), and thus, in use, the threshold Vthwould only be exceeded if the plug 102 were disconnected.

In embodiments of the present disclosure however, the threshold module302 may be operable so as to, in some circumstances, set the variablethreshold Vthv to a first threshold level vth1 which is within thepossible range of a driving signal V_(DL) that could be supplied to thefirst socket contact, i.e. the first threshold level Vth1 may be lowerthan the maximum possible signal driving voltage V_(DL-MAX). FIG. 4illustrates a possible driving signal V_(DL) and illustrates that thissignal V_(DL) could cause the voltage V_(M) at the monitoring node 114to exceed the lower threshold Vth1. Were the variable threshold Vthv tobe set to the first threshold level Vth1 at the same time that asignificant driving signal V_(DL) were being supplied to the firstsocket contact 103, the driving signal V_(DL) could result in thethreshold Vth1 being exceeded at the monitoring node 114, which couldresult in a false indication of disconnection of the plug 102.

The threshold module 302 is thus configured to set the variablethreshold Vthv based on an indication of activity of the signal V_(DL)at the first socket node 103 such that the variable threshold Vthv isset with knowledge of the expected signal level at the first socket node103. In this way the variable threshold Vthv can be set to anappropriate level which is higher than any expected component of thedriving signal V_(DL).

Embodiments of the present disclosure make use of the fact that, if asignificant audio driving signal V_(DL) is being driven to the T pole ofplug 102 by audio driving circuit 107 at the time that the plug 101 isdisconnected, i.e. if a music track say is being played at the time ofplug removal, there may in any case be an audible artefact as the drivesignals V_(DL) and possible V_(DR) to the loudspeakers of the accessorydevice are suddenly removed and/or the abrupt end to the audio will tendto mask the occurrence of any artefact due to the microphone biasV_(BIAS) being applied to the R1 and R2 poles of the plug 102 as it isremoved. Thus if a significant audio signal V_(DL) is being output tothe relevant loudspeaker pole T of the plug 102 at the time that it isremoved then it may not be important to disable the microphone biasV_(BIAS) as the plug is removed. In such a case a relatively longdetection time for detecting disconnection of the plug 102, say over theorder of a few hundred microseconds may be acceptable.

However if there is no or only a low level signal V_(DL) being output tothe loudspeaker pole T of the plug 102 when it is removed, which mayindicate that any audio playback corresponds to a quiet or silent periodor playback has been paused or stopped, then the effect of themicrophone bias V_(BIAS) being applied to other poles of the plug 102,e.g. the R1 and R2 poles of the plug 102, as it is removed may benoticeable for a user of the accessory apparatus. In such a case howeverthe signal V_(DL) supplied to the first socket contact 103 will be lowin level and the voltage at the first socket contact 103 will remainnear ground. Thus a lower threshold value Vth1 can be used for thevariable threshold Vthv without risk of the drive signal V_(DL) causingthe voltage at the monitoring node V_(M) to exceed the threshold Vth1.Using the lower threshold Vth1 means that if the plug 102 is removed atsuch a time, the monitor 115 will detect the disconnection much faster,say within 100 μs or less, which can allow the microphone bias V_(BIAS)to be disabled in sufficient time to reduce the chance of any audibleartefacts as the plug 102 is removed.

In some embodiments the threshold module 302 may thus apply a firstthreshold Vth1 during any periods of relatively low level of signalactivity at the first socket contact 103 and may apply a second, higher,threshold Vth2 during any period of higher signal activity at the firstsocket contact 103.

The threshold monitor 302 may determine the level of signal activity atthe first socket contact 103 in a variety of ways.

In some instances the threshold module 302 may be responsive to a signalHP_(EN) which enables or disables at least some aspects of the audiodriver circuitry 107, such as a driver amplifier. Typically when notbeing used to drive an audio signal V_(DL) the audio driver circuitry107 may be at least partly disabled to reduce power consumption. In someinstances the enable signal HP_(EN) for enabling or disabling the audiodriver circuitry 107 could be used as the indication of signal activity.If the audio driver circuitry 107 is not enabled then clearly no drivesignal V_(DL) would be expected and a first low threshold value Vth1could be used. Once the audio driver circuitry 107 is enabled it may beexpected that a drive signal V_(DL) may be produced and a second higherthreshold value Vth2 may be used.

Additionally or alternatively the threshold module 302 may be responsiveto a signal HP_(CL) for clamping the output path for the audio drivercircuitry 107 to ground. Typically a clamp switch 303 will be providedto selectively clamp the output of the audio driver circuitry 107 toground when not being used. When the ground clamp is enabled the firstsocket contact 103 will thus be clamped to ground and the lowerthreshold value Vth1 may be used. Again when the clamp switch 303 isdisabled it may be expected that the audio circuit may drive someno-zero signal V_(DL) to the first socket contact 103 and the higherthreshold value Vth2 may be used.

In some embodiments the audio driver circuitry 107 may provide anindication S_(ACT) of signal activity. This could for instance bederived by monitoring some aspect of operation of the audio drivercircuitry 107. For example in some implementations the audio drivercircuitry 107 may comprise an envelope detector or similar (notseparately indicated) for detecting an envelope or peak level of theaudio signal for controlling some aspect of operation of the audiodriver circuitry 107, e.g. a power supply to an amplifier of the audiodriver circuitry 107, and the indication of activity signal S_(ACT)could comprise the peak or envelope value. In such a case the thresholdmodule 302 may be operable to implement more than two differentthreshold values for the variable threshold Vthv with the relevantthreshold value being selected based on the indication of peak orenvelope value for the audio signal. In some embodiments the audiodriver circuit 107 may comprise a low level detector for detecting alow-level part of the audio signal and the indication Act of the signalactivity may be obtained from the low level detector.

In some instances the threshold module 302 could receive a signal S_(L)from some processing module upstream of the audio driver circuit 107which is indicative of the signal activity. This could for instance be adigital version of the audio signal for producing the audio drivingsignal Von or some parameter such as an envelope or peak valuedetermined upstream.

In some embodiments the indication of signal activity may additionallyor alternatively comprise a volume control signal, Vol, indicating someuser or system controlled volume setting. If the volume signal indicatesthat some volume controlled gain has been applied, resulting in a lowlevel signal V_(DL), this may be taken as an indication of signalactivity at the first socket node 103.

Based on the indication of signal activity the threshold module 302controls the variable threshold Vthv. In some embodiments the thresholdmodule 302 may generate different analogue threshold voltages, e.g. Vth1and Vth2, depending on the indication of signal activity. For instancethe threshold module could generate a suitable digital threshold valuewhich is converted to analogue by a digital-to-analogue converter, orthe threshold module may control the tap point from one or morepotential dividers etc. One skilled in the art would be well aware ofvarious ways in which different threshold voltages could be generated.

In some implementations the threshold module 302 could output a digitalthreshold value Vthv and the monitor 115 could convert the voltage V_(M)at the monitoring node to a digital signal for comparison with thethreshold.

In some embodiments the monitor may comprise multiple comparatorelements which each monitor the voltage V_(M), or version thereof, witha respective threshold and threshold module 302 may effectively selectwhich comparator element is used based on the indication of signalactivity. FIG. 5 illustrates one example of monitor 115 which comprisescomparators 115-1 and 115-2 arranged to compare the voltage V_(M) withfirst and second thresholds Vth1 and Vth2 respectively. In this examplethe respective threshold are derived from a potential divider 501 butthe threshold voltages could be derived in other ways, e.g. fromseparate potential dividers or reference voltage generators etc. Thethreshold module 302 effectively selects which comparator to use basedon the indication of signal activity.

FIG. 4 illustrates that in the presence of an indication of signalactivity, the variable threshold is switched from a lower value Vth1 toa higher value Vth2. This increases the response time and thus increasesthe likelihood of transient audible artefacts. These may often but notalways be adequately masked by an audio signal present. However in someembodiments, as a result of an indication of signal activity, the valueof the pull-up resistance 113 may be switched to a lower value, inaddition to switching to a higher threshold. Thus the response toremoval may be more similar to that of curve 201, rising to Vth2 by timeT1, or at least by some time less than T2, providing a more rapidreaction than curve 202. In many host devices there is unlikely to beaudio signal activity at the jack contacts once the host system becomesaware that a jack has been pulled out, thus there are unlikely to beprolonged periods of time when the lower resistance is selected whilethe socket is empty, thus mitigating any moisture-related corrosionreliability issues. The pull-up resistance 113 may comprise elements inseries or parallel, which may be switched in and out of circuit byswitches, for example using MOS transistors as switches. In someembodiments the pull-up resistance may be replaced wholly or partly byanother type of pull-up element, for instance a current source ofprogrammable value.

Referring back to FIG. 3, the output of monitor 115 may be provided to acontroller 304 which may determine the connection status of the plugbased on the output of the monitor 115. In particular the controller 304may determine disconnection of the plug 102 if the output of the monitor115 indicates that the voltage V_(M) at the monitoring node goes frombeing below the threshold to above the threshold. The controller may beconfigured to control operation of at least one signal path to one ofthe socket contacts 103-106. The controller 304 may, for instance,generate control signals, for instance so as to control thesignals/voltages applied to at least one of the other socket contacts104-106 to avoid the possibility of unwanted audible artefacts.

For example in some embodiments the controller 304 may be configured togenerate a control signal M_(EN) for enabling or disabling themicrophone biasing circuitry 109 so as to enable or disable themicrophone bias V_(BIAS) based on whether a jack plug 102 is present ornot. In particular when the output of the monitor 115 changes state toindicate that the jack detect contact 112 is no longer electricallyconnected to the first socket contact 103, the controller 304 maygenerate or control the M_(EN) signal to disable the microphone biasingcircuitry 109, which may in some embodiments including switching one ormore capacitors coupled to the biasing path to discharge and/or to beisolated from the biasing path. Additionally or alternatively thecontroller 304 may activate a clamping switch 305 for clamping themicrophone biasing path to ground.

In some embodiments the controller 304 may also control the enabling ordisabling of the audio driver circuits 107 and/or 108 and/or may controlclamp switches, e.g. clamp switch 303, for clamping the outputs of theaudio driver circuits 107 and/or 108 to ground. The controller may alsogenerate a jack detect signal JDet for some other component of thedevice, e.g. an applications processor or the like to take appropriateaction.

Embodiments of the disclosure thus allow the use of pull-up elementsthat provide a more limited current flow in use than pull-up elementsthat would conventionally be used for jack detect socket monitoring,thus reducing the problem of unwanted current flow due to moisturewithin the socket and possible damage/corrosion. The slower rate ofvoltage change at the monitoring node is compensated by using a lowerthan conventional threshold voltage during period when the signalactivity of a signal path that couples to the monitoring node isrelatively low.

The embodiments described above have discussed the use of pull-upresistors as the pull up elements but other pull-up arrangements may beused, for example FIG. 6 illustrates a socket monitoring circuit with acurrent source as pull-up element 113.

Embodiments thus provide circuitry for monitoring a socket to detectwhen a plug has been inserted that do not require the activation of amechanical switch and can detect the presence of a plug through aresultant electrical connection of two socket contacts. In someembodiments the socket which is monitored may be a socket of a hostdevice, e.g. such as a smartphone or tablet computer or the like.

FIG. 7 illustrates an electronic device 700 which may be any type ofelectronic device which may be operable with an audio accessoryapparatus to output audio to the audio accessory apparatus signals, e.g.for playback, and/or receive audio signals from the audio accessoryapparatus, e.g. a microphone signal. The device may therefore comprisean audio circuit, such as a codec 701, capable of input and output ofanalogue audio signals.

In some implementations the device 700 may have a socket 702, such as aconventional 3.5 mm audio socket for input/output of analogue audiosignals. The socket 702 may for instance be four-pole socket TRRS socketsuch as described above. The codec 701 may be coupled to the socket 702via suitable signal paths 703. A monitoring circuit 704, which may be amonitoring circuit such as described above with reference to any of FIG.3, 5 or 6, is also coupled to the socket 702 and operable to detect thepresence of a plug within the socket as discussed above. In this examplethe monitoring circuit forms at least part of codec 701.

In some instances however the socket monitored by the monitoring circuit704 may be a socket of an external accessory apparatus, such as anadapter apparatus, which may be connected to the device via someremovable connector suitable for general data transfer and operable fordigital data transfer.

Many electronic devices may include a connection interface suitable fordigital data transfer, for instance a USB connector (e.g. a micro USB orUSB-C connector for example) or a Lightening connector. Thus the device700 may comprise a general purpose connector, for example a USB-Ccompliant receptacle 705, for receiving a mating connector 706 of anaccessory apparatus.

Data transfer via the general purpose connector, i.e. receptacle 705,may be controlled by a physical layer controller PHY 707. PHY 707 maymonitor the status of receptacle 705 to determine a connection statusand also, when insertion of a suitable plug is detected, to determinethe type of accessory connected. In some embodiments the codec 701 maybe able to input and output digital audio data via the general purposeconnector, i.e. receptacle 705, via suitable digital data paths 708.

In some instances, especially in cases where the device 700 does nothave its own dedicated audio socket, i.e. there is no jack-socket foranalogue audio, it may be possible to transfer analogue audio to andfrom an accessory apparatus connected via the general purpose connector,i.e. receptacle 705. For instance the USB Type-C Specification definesan Audio Adapter Accessory Mode. In this mode defined pins of the USBType-C connector are used for analogue left and right audio signals, amicrophone bias/input path and ground, i.e. the conventional connectionsfor a TRRS analogue connector. This makes it possible to use legacyanalogue accessory apparatus, such as legacy headsets having a 3.5 mmjack plug, by using a 3.5 mm jack to USB Type-C adapter.

FIG. 7 also illustrates an example of an adapter apparatus 709. Theadapter 709 has a plug 706, e.g. a USB-C compliant plug, for mating withthe receptacle 705 of device 700. Connected to plug 706 via suitablesignals paths is a socket 702 a, which may be a conventional 3.5 mmthree- or four-pole socket, for instance a TRRS socket suitable forreceiving a TRRS plug 102.

In use the general purpose connector of the adapter, e.g. USB-Ccompliant plug 706, may removably connected to the receptacle 705 ofdevice 700. The PHY 707, which is monitoring receptacle 705, will detectinsertion of plug 706. PHY 707 will also detect, for example from thevalues of certain defined resistances coupled to defined pins when theplug is mated, that the connected accessory is one for which analogueaudio transfer is required. Thus for a USB-C connector the PHY 707 willconfigure the receptacle, e.g. USB receptacle 705, for example tooperate in the Analogue Adapter Accessory mode in accordance with AnnexA of the USB type-C specification, and signal paths 710 for analogueaudio will be established between the codec 701 and external socket 702a. The host device 700 will then be able to transfer analogue audiosignals from/to an analogue audio accessory device which is connected tothe external socket 702 a.

In use the PHY 707 monitors the receptacle 705 for presence of a matingplug 706. When an adapter apparatus 709 is connected, the PHY 707 willdetermine that a suitable plug is inserted and configure the interfaceof the receptacle 705 accordingly. There may however still be a desireto determine whether or not there is a plug present in the externalsocket 702 a.

In some embodiments the external socket 702 a may have contacts locatedin the socket that are arranged to contact the same pole of a plug whenfully inserted in a similar manner as discussed above, i.e. the externalsocket could be arranged with two contacts that will be shorted togetherby one of the poles of the plug when inserted. In such embodiments thePHY 707 may be arranged such that signal paths 710 used in an analoguemode include at least one jack-detect path, e.g. referring back to FIG.3 the analogue signal paths 710 could include a path from monitoringnode 114 of monitoring circuit 704 to a tip contact of the externalsocket 702 a, as well as the normal audio path to the tip contact. Inthis case the monitoring circuit 704 of the codec 701, can monitor theexternal socket in the same way as discussed above for a socket of thehost device itself. The audio signals for the relevant left and rightaudio poles of the external socket will be generated and supplied to therelevant contacts of the receptacle 705 by the codec 701 and themonitoring circuitry can obtain an indication of signal activity in thesame way as discussed above.

The skilled person will recognise that some aspects of theabove-described apparatus and methods, for example the discovery andconfiguration methods may be embodied as processor control code, forexample on a non-volatile carrier medium such as a disk, CD- or DVD-ROM,programmed memory such as read only memory (Firmware), or on a datacarrier such as an optical or electrical signal carrier. For manyapplications, embodiments will be implemented on a DSP (Digital SignalProcessor), ASIC (Application Specific Integrated Circuit) or FPGA(Field Programmable Gate Array). Thus the code may comprise conventionalprogram code or microcode or, for example code for setting up orcontrolling an ASIC or FPGA. The code may also comprise code fordynamically configuring re-configurable apparatus such asre-programmable logic gate arrays. Similarly the code may comprise codefor a hardware description language such as Verilog™ or VHDL (Very highspeed integrated circuit Hardware Description Language). As the skilledperson will appreciate, the code may be distributed between a pluralityof coupled components in communication with one another. Whereappropriate, the embodiments may also be implemented using code runningon a field-(re)programmable analogue array or similar device in order toconfigure analogue hardware.

At least some embodiments may be implemented in a host device,especially a portable and/or battery powered host device. Someembodiments may be implemented in an electronic device which maycomprise at least one of: a communication device, a mobile or cellulartelephone, a smartphone; a computing device; a laptop, notebook ortablet computing device; a media player; a games device; a wearabledevice; a smartwatch; a voice controlled device.

It should be noted that the above-mentioned embodiments illustraterather than limit the invention, and that those skilled in the art willbe able to design many alternative embodiments without departing fromthe scope of the appended claims. The word “comprising” does not excludethe presence of elements or steps other than those listed in a claim,“a” or “an” does not exclude a plurality, and a single feature or otherunit may fulfil the functions of several units recited in the claims.Any reference numerals or labels in the claims shall not be construed soas to limit their scope.

1.-20. (canceled)
 21. An electronic device comprising: a first connectorfor making a removable connection with an accessory apparatus via amating connector of the accessory apparatus; a controller forcontrolling data transfer via the first connector, the controller beingoperable in a first mode to enable transfer of analogue signals via thefirst connector when the accessory apparatus connected to the firstconnector comprises an analogue adaptor accessory having said matingconnector and a jack-socket; and a socket monitoring circuit formonitoring, when the analogue adaptor accessory is connected to thefirst connector, whether a plug is inserted in said jack-socket;wherein, in the first mode operation, the controller is operable toestablish a first signal path to a first device contact of the firstconnector that couples, via said mating connector of the analogueadaptor accessory, to a first socket contact of said jack socket; andwherein the socket monitoring circuit comprises: a voltage monitorconfigured to monitor a voltage at a monitoring node against a variablethreshold, wherein, in the first mode, the monitoring node iselectrically connected to a second device contact of the first connectorthat couples, via said mating connector of the analogue adaptoraccessory, to a jack detect socket contact of said jack-socket, whereinthe jack detect socket contact and said first socket contact makecontact with a same plug contact of a plug when inserted into thejack-socket, and a threshold module configured to vary said variablethreshold depending on an indication of signal activity of said firstsignal path.
 22. The electronic device as claimed in claim 21 whereinthe controller is also operable in at least a second mode to enabletransfer of digital signals via the first connector when the accessoryapparatus connected to the first connector is capable of digital datatransfer.
 23. The electronic device as claimed in claim 21 wherein thefirst connector is a general purpose data connector.
 24. The electronicdevice as claimed in claim 21 wherein the first connector is a USBconnector.
 25. The electronic device as claimed in claim 21 wherein saidfirst signal path comprises an output audio path for outputting ananalogue audio signal.
 26. The electronic device as claimed in claim 21wherein the threshold module is configured to set said variablethreshold to a first value when said indication of signal activityindicates a first level of activity and to set said variable thresholdto a second, higher, value when said indication of signal activityindicates a second greater level of activity.
 27. The electronic deviceas claimed in claim 21 further comprising a voltage pull-up elementwhich is connected to the monitoring node in the first mode ofoperation.
 28. The electronic device as claimed in claim 27 wherein thevoltage pull-up element is controllable so as to vary a magnitude ofexpected current flow when the jack detect contact is electricallyconnected to the first socket contact of said jack-socket.
 29. Theelectronic device as claimed in claim 28 wherein the monitoring circuitis configured to control the pull-up element so as to provide a highermagnitude of expected current flow when said indication of signalactivity indicates that there is signal activity in the first signalpath than when said indication of signal activity indicates that thereis substantially no signal activity in said first signal path.
 30. Theelectronic device as claimed in claim 21 further comprising a clampswitch for clamping the first signal path to ground and said indicationof signal activity comprises an indication of whether said clamp switchis enabled or not.
 31. The electronic device as claimed in claim 21further comprising a first output driver for the first signal path andsaid indication of signal activity comprises an indication of outputsignal level for an output of the first output driver.
 32. Theelectronic device as claimed in claim 21 wherein the electronic devicefurther comprises a device jack-socket and the socket monitoring circuitis further configured to monitor whether a plug is inserted in saiddevice jack-socket.
 33. A socket monitoring circuit comprising: amonitor configured to monitor a voltage at a monitoring node against avariable threshold, the monitoring node being couple to a voltagepull-up element; a threshold module configured to vary said variablethreshold depending on an indication of signal activity of a firstsignal path; and a controller operable in a first mode to establish thefirst signal path to a first device contact of a first connector and tocouple the monitoring node to a voltage-pull up element and to a seconddevice contact of the first connector; wherein the first connector is ageneral purpose data connector and is operable to make a connection withan analogue adaptor accessory having a jack-socket such that the firstdevice contact is electrically connected to a first socket contact ofsaid jack-socket and the second device contact is electrically connectedto a jack-detect socket contact of said jack-socket, where the jackdetect socket contact and said first socket contact make contact with asame plug contact of a plug when inserted into the jack-socket.
 34. Thesocket monitoring circuit as claimed in claim 33 wherein the thresholdmodule is configured to set said variable threshold to a first valuewhen said indication of signal activity indicates a first level ofactivity and to set said variable threshold to a second, higher, valuewhen said indication of signal activity indicates a second greater levelof activity.
 35. The socket monitoring circuit as claimed in claim 33wherein said first signal path is an audio signal path for supplying anaudio output signal to the first device contact of the first connector.36. The socket monitoring circuit as claimed in claim 33 wherein thefirst connector is a connector suitable for transfer of digital data.37. The socket monitoring circuit as claimed in claim 33 wherein thefirst connector is a USB compliant connector.
 38. An apparatuscomprising: a first connector for making a removable connection with anaccessory apparatus via a mating connector of the accessory apparatus;and controller for controlling signal transfer via the first connector,the controller being operable in a digital mode to enable digital datasignals to be transferred via the first connector and also in ananalogue mode to enable analogue signals to be transferred via the firstconnector; the controller being operable in the analogue mode when theaccessory apparatus connected to the first connector comprises ananalogue adaptor accessory comprising a jack-socket for transfer ofanalogue signals received via the mating connector; the apparatusfurther comprising a socket monitoring circuit for monitoring, when theanalogue adaptor accessory is connected to the first connector, whethera plug is inserted in said jack-socket of the analogue accessory. 39.The apparatus of claim 38 wherein: the controller is configured, whenthe analogue adaptor accessory is connected to the first connector, toestablish a first signal path to a first device contact of the firstconnector that couples, via said mating connector of the analogueadaptor accessory, to a first socket contact of said jack-socket; andthe socket monitoring circuit comprises: a voltage monitor configured tomonitor a voltage at a monitoring node against a first threshold,wherein, in the first mode, the monitoring node is electricallyconnected to a second device contact of the first connector thatcouples, via said mating connector of the analogue adaptor accessory, toa jack detect socket contact of said jack-socket, wherein the jackdetect socket contact and said first socket contact make contact with asame plug contact of a plug when inserted into the jack-socket.
 40. Theapparatus of claim 38 wherein the socket monitoring circuit furthercomprises a threshold module configured to vary said first thresholddepending on an indication of signal activity of said first signal path.